package login

import (
	"OnlineRetailers/controllers/OpenId"
	"fmt"
)

func CheckOpenid(openidTemp []string) (err error, openid string) {
	if len(openidTemp) == 0 {
		err = fmt.Errorf("openidNull")
		return
	}
	openid = openidTemp[0]
	if openid == "" {
		err = fmt.Errorf("openidNull")
		return
	}

	err = OpenId.CheckOpenId(openid)
	//fmt.Println(ses.Admin)
	if err != nil {
		return
	}
	return nil, openid
}
